/*
 * File.java
 *
 * Created on 22 September 2006, 12:23
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package libjdc.dc.filelist;

/**
 *
 * @author root
 */
public class File implements Comparable {
    
    private String name, size, TTH;
    private int count;
    
    /** Creates a new instance of File */
    public File(String name, String size,String TTH) {
        this.name = name;
        this.size = size;
        this.TTH = TTH;
        this.count = 1;
    }

    public String getName() {
        return name;
    }

    public String getSize() {
        return size;
    }

    public String getTTH() {
        return TTH;
    }
    
    public int getCount(){
        return count;
    }
    
    public void setCount(int count){
        this.count = count;
    }
    
    public String toString(){
        return "name:"+name+" size:"+size+" tth:"+TTH+" count:"+count;
    }

    public int compareTo(Object o) {
        return (getName()+""+getSize()+""+getTTH()).compareTo(((libjdc.dc.filelist.File)o).getName()+""+((libjdc.dc.filelist.File)o).getSize()+""+((libjdc.dc.filelist.File)o).getTTH());
    }
    
}
